package org.example.curriculum_design_6_16.entity.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import jakarta.validation.constraints.*;
import lombok.Data;

import java.io.Serializable;

/**
 * 成绩数据传输对象
 */
@ApiModel(description = "成绩数据传输对象")
@Data
public class GradeFormDTO implements Serializable {

    @ApiModelProperty(value = "学生ID", required = true)
    @NotBlank(message = "学生ID不能为空")
    private String studentId;

    @ApiModelProperty(value = "课程ID", required = true)
    @NotBlank(message = "课程ID不能为空")
    private String courseId;

    @ApiModelProperty(value = "成绩分数", required = true)
    @NotNull(message = "成绩分数不能为空")
    @DecimalMin(value = "0.0", message = "成绩不能小于0分")
    @DecimalMax(value = "100.0", message = "成绩不能超过100分")
    private Double score;

    @ApiModelProperty(value = "学期", required = true)
    @NotBlank(message = "学期不能为空")
    @Pattern(regexp = "^\\d{4}-\\d{4}-[1-2]$",
            message = "学期格式应为YYYY-YYYY-1或YYYY-YYYY-2")
    private String semester;

    @ApiModelProperty(value = "备注")
    private String remark;
}